<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ATOMISM: src/Base/muparser_v2_2_3/muParserToken.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">ATOMISM
   
   </div>
   <div id="projectbrief">A C++ library and a python module to study the motion of undiviseable entities</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">src/Base/muparser_v2_2_3/muParserToken.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="mu_parser_token_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">                 __________                                      </span>
<a name="l00003"></a>00003 <span class="comment">    _____   __ __\______   \_____  _______  ______  ____ _______ </span>
<a name="l00004"></a>00004 <span class="comment">   /     \ |  |  \|     ___/\__  \ \_  __ \/  ___/_/ __ \\_  __ \</span>
<a name="l00005"></a>00005 <span class="comment">  |  Y Y  \|  |  /|    |     / __ \_|  | \/\___ \ \  ___/ |  | \/</span>
<a name="l00006"></a>00006 <span class="comment">  |__|_|  /|____/ |____|    (____  /|__|  /____  &gt; \___  &gt;|__|   </span>
<a name="l00007"></a>00007 <span class="comment">        \/                       \/            \/      \/        </span>
<a name="l00008"></a>00008 <span class="comment">  Copyright (C) 2004-2013 Ingo Berg</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">  Permission is hereby granted, free of charge, to any person obtaining a copy of this </span>
<a name="l00011"></a>00011 <span class="comment">  software and associated documentation files (the &quot;Software&quot;), to deal in the Software</span>
<a name="l00012"></a>00012 <span class="comment">  without restriction, including without limitation the rights to use, copy, modify, </span>
<a name="l00013"></a>00013 <span class="comment">  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to </span>
<a name="l00014"></a>00014 <span class="comment">  permit persons to whom the Software is furnished to do so, subject to the following conditions:</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment">  The above copyright notice and this permission notice shall be included in all copies or </span>
<a name="l00017"></a>00017 <span class="comment">  substantial portions of the Software.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment">  THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT</span>
<a name="l00020"></a>00020 <span class="comment">  NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND </span>
<a name="l00021"></a>00021 <span class="comment">  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, </span>
<a name="l00022"></a>00022 <span class="comment">  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, </span>
<a name="l00023"></a>00023 <span class="comment">  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </span>
<a name="l00024"></a>00024 <span class="comment">*/</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef MU_PARSER_TOKEN_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define MU_PARSER_TOKEN_H</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;cassert&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;stack&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;memory&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="mu_parser_error_8h.html" title="This file defines the error class used by the parser.">muParserError.h</a>&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="mu_parser_callback_8h.html" title="Definition of the parser callback class.">muParserCallback.h</a>&quot;</span>
<a name="l00037"></a>00037 
<a name="l00042"></a>00042 <span class="keyword">namespace </span>mu
<a name="l00043"></a>00043 {
<a name="l00060"></a>00060   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> TBase, <span class="keyword">typename</span> TString&gt;
<a name="l00061"></a><a class="code" href="classmu_1_1_parser_token.html">00061</a>   <span class="keyword">class </span><a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>
<a name="l00062"></a>00062   {
<a name="l00063"></a>00063   <span class="keyword">private</span>:
<a name="l00064"></a>00064 
<a name="l00065"></a>00065       <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40e" title="Bytecode values.">ECmdCode</a>  m_iCode;  
<a name="l00066"></a>00066       <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302" title="Types internally used by the parser.">ETypeCode</a> m_iType;
<a name="l00067"></a>00067       <span class="keywordtype">void</span>  *m_pTok;      
<a name="l00068"></a>00068       <span class="keywordtype">int</span>  m_iIdx;        
<a name="l00069"></a>00069       TString m_strTok;   
<a name="l00070"></a>00070       TString m_strVal;   
<a name="l00071"></a>00071       <a class="code" href="namespacemu.html#a17d4f113a4b88b8d971cca8ddbbe8a47" title="The numeric datatype used by the parser.">value_type</a> m_fVal;  
<a name="l00072"></a>00072       std::auto_ptr&lt;ParserCallback&gt; m_pCallback;
<a name="l00073"></a>00073 
<a name="l00074"></a>00074   <span class="keyword">public</span>:
<a name="l00075"></a>00075 
<a name="l00076"></a>00076       <span class="comment">//---------------------------------------------------------------------------</span>
<a name="l00083"></a><a class="code" href="classmu_1_1_parser_token.html#a0ce34ca6a1833441e8fd9840b3cde140">00083</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html#a0ce34ca6a1833441e8fd9840b3cde140" title="Constructor (default).">ParserToken</a>()
<a name="l00084"></a>00084         :m_iCode(<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eabd8cbb2e08ff6806578535408feef0c3" title="uninitialized item">cmUNKNOWN</a>)
<a name="l00085"></a>00085         ,m_iType(<a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302a2a6b3ae75a0e6a44a992a87d222b4481" title="Undefined type.">tpVOID</a>)
<a name="l00086"></a>00086         ,m_pTok(0)
<a name="l00087"></a>00087         ,m_iIdx(-1)
<a name="l00088"></a>00088         ,m_strTok()
<a name="l00089"></a>00089         ,m_pCallback()
<a name="l00090"></a>00090       {}
<a name="l00091"></a>00091 
<a name="l00092"></a>00092       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00100"></a><a class="code" href="classmu_1_1_parser_token.html#a17dfc71fe5750f61e9cdd5c2a3355ac0">00100</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html#a0ce34ca6a1833441e8fd9840b3cde140" title="Constructor (default).">ParserToken</a>(<span class="keyword">const</span> <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a> &amp;a_Tok)
<a name="l00101"></a>00101       {
<a name="l00102"></a>00102         <a class="code" href="classmu_1_1_parser_token.html#a40b7e717927c58d03a6665184ff5cc52" title="Copy token information from argument.">Assign</a>(a_Tok);
<a name="l00103"></a>00103       }
<a name="l00104"></a>00104       
<a name="l00105"></a>00105       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00112"></a><a class="code" href="classmu_1_1_parser_token.html#af9abe46bd0a5f2b4cbcc59beba68ca0e">00112</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#af9abe46bd0a5f2b4cbcc59beba68ca0e" title="Assignement operator.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a> &amp;a_Tok)
<a name="l00113"></a>00113       {
<a name="l00114"></a>00114         <a class="code" href="classmu_1_1_parser_token.html#a40b7e717927c58d03a6665184ff5cc52" title="Copy token information from argument.">Assign</a>(a_Tok);
<a name="l00115"></a>00115         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00116"></a>00116       }
<a name="l00117"></a>00117 
<a name="l00118"></a>00118       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00123"></a><a class="code" href="classmu_1_1_parser_token.html#a40b7e717927c58d03a6665184ff5cc52">00123</a> <span class="comment"></span>      <span class="keywordtype">void</span> <a class="code" href="classmu_1_1_parser_token.html#a40b7e717927c58d03a6665184ff5cc52" title="Copy token information from argument.">Assign</a>(<span class="keyword">const</span> <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a> &amp;a_Tok)
<a name="l00124"></a>00124       {
<a name="l00125"></a>00125         m_iCode = a_Tok.m_iCode;
<a name="l00126"></a>00126         m_pTok = a_Tok.m_pTok;
<a name="l00127"></a>00127         m_strTok = a_Tok.m_strTok;
<a name="l00128"></a>00128         m_iIdx = a_Tok.m_iIdx;
<a name="l00129"></a>00129         m_strVal = a_Tok.m_strVal;
<a name="l00130"></a>00130         m_iType = a_Tok.m_iType;
<a name="l00131"></a>00131         m_fVal = a_Tok.m_fVal;
<a name="l00132"></a>00132         <span class="comment">// create new callback object if a_Tok has one </span>
<a name="l00133"></a>00133         m_pCallback.reset(a_Tok.m_pCallback.get() ? a_Tok.m_pCallback-&gt;Clone() : 0);
<a name="l00134"></a>00134       }
<a name="l00135"></a>00135 
<a name="l00136"></a>00136       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00147"></a><a class="code" href="classmu_1_1_parser_token.html#ac4588ba38ccc660686956f7998ba74dc">00147</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#ac4588ba38ccc660686956f7998ba74dc" title="Assign a token type.">Set</a>(<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40e" title="Bytecode values.">ECmdCode</a> a_iType, <span class="keyword">const</span> TString &amp;a_strTok=TString())
<a name="l00148"></a>00148       {
<a name="l00149"></a>00149         <span class="comment">// The following types cant be set this way, they have special Set functions</span>
<a name="l00150"></a>00150         assert(a_iType!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eafa2a28b5022d2454768c74e15d5ae377" title="variable item">cmVAR</a>);
<a name="l00151"></a>00151         assert(a_iType!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eab1cf4ef5d34d815bb016fef14c331622" title="value item">cmVAL</a>);
<a name="l00152"></a>00152         assert(a_iType!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eaeacb1b1bb9859e8bc6147887a787feca" title="Code for a generic function item.">cmFUNC</a>);
<a name="l00153"></a>00153 
<a name="l00154"></a>00154         m_iCode = a_iType;
<a name="l00155"></a>00155         m_iType = <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302a2a6b3ae75a0e6a44a992a87d222b4481" title="Undefined type.">tpVOID</a>;
<a name="l00156"></a>00156         m_pTok = 0;
<a name="l00157"></a>00157         m_strTok = a_strTok;
<a name="l00158"></a>00158         m_iIdx = -1;
<a name="l00159"></a>00159 
<a name="l00160"></a>00160         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00161"></a>00161       }
<a name="l00162"></a>00162 
<a name="l00163"></a>00163       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00165"></a><a class="code" href="classmu_1_1_parser_token.html#aa7c0c0e307b2064f1ab12cbf922c7e40">00165</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#ac4588ba38ccc660686956f7998ba74dc" title="Assign a token type.">Set</a>(<span class="keyword">const</span> <a class="code" href="classmu_1_1_parser_callback.html" title="Encapsulation of prototypes for a numerical parser function.">ParserCallback</a> &amp;a_pCallback, <span class="keyword">const</span> TString &amp;a_sTok)
<a name="l00166"></a>00166       {
<a name="l00167"></a>00167         assert(a_pCallback.<a class="code" href="classmu_1_1_parser_callback.html#a509c3106a4adea192e3f8044898e18a7" title="Get the callback address for the parser function.">GetAddr</a>());
<a name="l00168"></a>00168 
<a name="l00169"></a>00169         m_iCode = a_pCallback.<a class="code" href="classmu_1_1_parser_callback.html#a8aba600cfcc29227674ec367f6dca6dd" title="Return the callback code.">GetCode</a>();
<a name="l00170"></a>00170         m_iType = <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302a2a6b3ae75a0e6a44a992a87d222b4481" title="Undefined type.">tpVOID</a>;
<a name="l00171"></a>00171         m_strTok = a_sTok;
<a name="l00172"></a>00172         m_pCallback.reset(<span class="keyword">new</span> <a class="code" href="classmu_1_1_parser_callback.html" title="Encapsulation of prototypes for a numerical parser function.">ParserCallback</a>(a_pCallback));
<a name="l00173"></a>00173 
<a name="l00174"></a>00174         m_pTok = 0;
<a name="l00175"></a>00175         m_iIdx = -1;
<a name="l00176"></a>00176         
<a name="l00177"></a>00177         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00178"></a>00178       }
<a name="l00179"></a>00179 
<a name="l00180"></a>00180       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00186"></a><a class="code" href="classmu_1_1_parser_token.html#a68d4974b234ee9f109ef466cd04e1501">00186</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#a68d4974b234ee9f109ef466cd04e1501" title="Make this token a value token.">SetVal</a>(TBase a_fVal, <span class="keyword">const</span> TString &amp;a_strTok=TString())
<a name="l00187"></a>00187       {
<a name="l00188"></a>00188         m_iCode = <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eab1cf4ef5d34d815bb016fef14c331622" title="value item">cmVAL</a>;
<a name="l00189"></a>00189         m_iType = <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302a38692f5e59ea960113e0de77ed9a9428" title="Floating point variables.">tpDBL</a>;
<a name="l00190"></a>00190         m_fVal = a_fVal;
<a name="l00191"></a>00191         m_strTok = a_strTok;
<a name="l00192"></a>00192         m_iIdx = -1;
<a name="l00193"></a>00193         
<a name="l00194"></a>00194         m_pTok = 0;
<a name="l00195"></a>00195         m_pCallback.reset(0);
<a name="l00196"></a>00196 
<a name="l00197"></a>00197         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00198"></a>00198       }
<a name="l00199"></a>00199 
<a name="l00200"></a>00200       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00206"></a><a class="code" href="classmu_1_1_parser_token.html#a86de84eb76900ca677c3ab93681ec7c5">00206</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#a86de84eb76900ca677c3ab93681ec7c5" title="make this token a variable token.">SetVar</a>(TBase *a_pVar, <span class="keyword">const</span> TString &amp;a_strTok)
<a name="l00207"></a>00207       {
<a name="l00208"></a>00208         m_iCode = <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eafa2a28b5022d2454768c74e15d5ae377" title="variable item">cmVAR</a>;
<a name="l00209"></a>00209         m_iType = <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302a38692f5e59ea960113e0de77ed9a9428" title="Floating point variables.">tpDBL</a>;
<a name="l00210"></a>00210         m_strTok = a_strTok;
<a name="l00211"></a>00211         m_iIdx = -1;
<a name="l00212"></a>00212         m_pTok = (<span class="keywordtype">void</span>*)a_pVar;
<a name="l00213"></a>00213         m_pCallback.reset(0);
<a name="l00214"></a>00214         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00215"></a>00215       }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00223"></a><a class="code" href="classmu_1_1_parser_token.html#ada40ff914f9c59f6891f6809991b3542">00223</a> <span class="comment"></span>      <a class="code" href="classmu_1_1_parser_token.html" title="Encapsulation of the data for a single formula token.">ParserToken</a>&amp; <a class="code" href="classmu_1_1_parser_token.html#ada40ff914f9c59f6891f6809991b3542" title="Make this token a variable token.">SetString</a>(<span class="keyword">const</span> TString &amp;a_strTok, std::size_t a_iSize)
<a name="l00224"></a>00224       {
<a name="l00225"></a>00225         m_iCode = <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40ea85db5789f85577dd5bcc21aea5b3244f" title="Code for a string token.">cmSTRING</a>;
<a name="l00226"></a>00226         m_iType = <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302ac02584cb1ca179714a5ac8a951653ad4" title="String type (Function arguments and constants only, no string variables)">tpSTR</a>;
<a name="l00227"></a>00227         m_strTok = a_strTok;
<a name="l00228"></a>00228         m_iIdx = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(a_iSize);
<a name="l00229"></a>00229 
<a name="l00230"></a>00230         m_pTok = 0;
<a name="l00231"></a>00231         m_pCallback.reset(0);
<a name="l00232"></a>00232         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00233"></a>00233       }
<a name="l00234"></a>00234 
<a name="l00235"></a>00235       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00242"></a><a class="code" href="classmu_1_1_parser_token.html#ac2e70ba039bc033722ea946342649881">00242</a> <span class="comment"></span>      <span class="keywordtype">void</span> <a class="code" href="classmu_1_1_parser_token.html#ac2e70ba039bc033722ea946342649881" title="Set an index associated with the token related data.">SetIdx</a>(<span class="keywordtype">int</span> a_iIdx)
<a name="l00243"></a>00243       {
<a name="l00244"></a>00244         <span class="keywordflow">if</span> (m_iCode!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40ea85db5789f85577dd5bcc21aea5b3244f" title="Code for a string token.">cmSTRING</a> || a_iIdx&lt;0)
<a name="l00245"></a>00245                 <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">ParserError</a>(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00246"></a>00246         
<a name="l00247"></a>00247         m_iIdx = a_iIdx;
<a name="l00248"></a>00248       }
<a name="l00249"></a>00249 
<a name="l00250"></a>00250       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00258"></a><a class="code" href="classmu_1_1_parser_token.html#a394d2f4c77548e20d6ea1d69ab583426">00258</a> <span class="comment"></span>      <span class="keywordtype">int</span> <a class="code" href="classmu_1_1_parser_token.html#a394d2f4c77548e20d6ea1d69ab583426" title="Return Index associated with the token related data.">GetIdx</a>()<span class="keyword"> const</span>
<a name="l00259"></a>00259 <span class="keyword">      </span>{
<a name="l00260"></a>00260         <span class="keywordflow">if</span> (m_iIdx&lt;0 || m_iCode!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40ea85db5789f85577dd5bcc21aea5b3244f" title="Code for a string token.">cmSTRING</a> )
<a name="l00261"></a>00261           <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">ParserError</a>(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00262"></a>00262 
<a name="l00263"></a>00263         <span class="keywordflow">return</span> m_iIdx;
<a name="l00264"></a>00264       }
<a name="l00265"></a>00265 
<a name="l00266"></a>00266       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00272"></a><a class="code" href="classmu_1_1_parser_token.html#a2aed855c2686a1a4f7696f373e79d2ba">00272</a> <span class="comment"></span>      <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40e" title="Bytecode values.">ECmdCode</a> <a class="code" href="classmu_1_1_parser_token.html#a2aed855c2686a1a4f7696f373e79d2ba" title="Return the token type.">GetCode</a>()<span class="keyword"> const</span>
<a name="l00273"></a>00273 <span class="keyword">      </span>{
<a name="l00274"></a>00274         <span class="keywordflow">if</span> (m_pCallback.get())
<a name="l00275"></a>00275         {
<a name="l00276"></a>00276           <span class="keywordflow">return</span> m_pCallback-&gt;GetCode();
<a name="l00277"></a>00277         }
<a name="l00278"></a>00278         <span class="keywordflow">else</span>
<a name="l00279"></a>00279         {
<a name="l00280"></a>00280           <span class="keywordflow">return</span> m_iCode;
<a name="l00281"></a>00281         }
<a name="l00282"></a>00282       }
<a name="l00283"></a>00283 
<a name="l00284"></a>00284       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00285"></a>00285       <a class="code" href="namespacemu.html#ac3ccf6a749baacffd48fe97b9c2af302" title="Types internally used by the parser.">ETypeCode</a> GetType()<span class="keyword"> const</span>
<a name="l00286"></a>00286 <span class="keyword">      </span>{
<a name="l00287"></a>00287         <span class="keywordflow">if</span> (m_pCallback.get())
<a name="l00288"></a>00288         {
<a name="l00289"></a>00289           <span class="keywordflow">return</span> m_pCallback-&gt;GetType();
<a name="l00290"></a>00290         }
<a name="l00291"></a>00291         <span class="keywordflow">else</span>
<a name="l00292"></a>00292         {
<a name="l00293"></a>00293           <span class="keywordflow">return</span> m_iType;
<a name="l00294"></a>00294         }
<a name="l00295"></a>00295       }
<a name="l00296"></a>00296       
<a name="l00297"></a>00297       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00298"></a>00298       <span class="keywordtype">int</span> GetPri()<span class="keyword"> const</span>
<a name="l00299"></a>00299 <span class="keyword">      </span>{
<a name="l00300"></a>00300         <span class="keywordflow">if</span> ( !m_pCallback.get())
<a name="l00301"></a>00301                 <span class="keywordflow">throw</span> ParserError(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00302"></a>00302             
<a name="l00303"></a>00303         <span class="keywordflow">if</span> ( m_pCallback-&gt;GetCode()!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eaacf35df01fc3b643b134e9d1ce3cc4e2" title="user defined binary operator">cmOPRT_BIN</a> &amp;&amp; m_pCallback-&gt;GetCode()!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40ea961fe96555e0f036e52496126f70c404" title="code for infix operators">cmOPRT_INFIX</a>)
<a name="l00304"></a>00304                 <span class="keywordflow">throw</span> ParserError(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00305"></a>00305 
<a name="l00306"></a>00306         <span class="keywordflow">return</span> m_pCallback-&gt;GetPri();
<a name="l00307"></a>00307       }
<a name="l00308"></a>00308 
<a name="l00309"></a>00309       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00310"></a>00310       <a class="code" href="namespacemu.html#aff435b0c277f66041374f93a3803e1f1" title="Parser operator precedence values.">EOprtAssociativity</a> GetAssociativity()<span class="keyword"> const</span>
<a name="l00311"></a>00311 <span class="keyword">      </span>{
<a name="l00312"></a>00312         <span class="keywordflow">if</span> (m_pCallback.get()==NULL || m_pCallback-&gt;GetCode()!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eaacf35df01fc3b643b134e9d1ce3cc4e2" title="user defined binary operator">cmOPRT_BIN</a>)
<a name="l00313"></a>00313                 <span class="keywordflow">throw</span> ParserError(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00314"></a>00314 
<a name="l00315"></a>00315         <span class="keywordflow">return</span> m_pCallback-&gt;GetAssociativity();
<a name="l00316"></a>00316       }
<a name="l00317"></a>00317 
<a name="l00318"></a>00318       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00333"></a><a class="code" href="classmu_1_1_parser_token.html#acd1dc5d9680562db1fcd5ca2bf6add85">00333</a> <span class="comment"></span>      <a class="code" href="namespacemu.html#af84e949f8a148fb4af0cde3e52522604" title="Callback type used for functions without arguments.">generic_fun_type</a> <a class="code" href="classmu_1_1_parser_token.html#acd1dc5d9680562db1fcd5ca2bf6add85" title="Return the address of the callback function assoziated with function and operator tokens...">GetFuncAddr</a>()<span class="keyword"> const</span>
<a name="l00334"></a>00334 <span class="keyword">      </span>{
<a name="l00335"></a>00335         <span class="keywordflow">return</span> (m_pCallback.get()) ? (<a class="code" href="namespacemu.html#af84e949f8a148fb4af0cde3e52522604" title="Callback type used for functions without arguments.">generic_fun_type</a>)m_pCallback-&gt;GetAddr() : 0;
<a name="l00336"></a>00336       }
<a name="l00337"></a>00337 
<a name="l00338"></a>00338       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00344"></a><a class="code" href="classmu_1_1_parser_token.html#a92bdbe69e20244358ff7b8348cee4162">00344</a> <span class="comment"></span>      TBase <a class="code" href="classmu_1_1_parser_token.html#a92bdbe69e20244358ff7b8348cee4162">GetVal</a>()<span class="keyword"> const</span>
<a name="l00345"></a>00345 <span class="keyword">      </span>{
<a name="l00346"></a>00346         <span class="keywordflow">switch</span> (m_iCode)
<a name="l00347"></a>00347         {
<a name="l00348"></a>00348           <span class="keywordflow">case</span> <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eab1cf4ef5d34d815bb016fef14c331622" title="value item">cmVAL</a>:  <span class="keywordflow">return</span> m_fVal;
<a name="l00349"></a>00349           <span class="keywordflow">case</span> <a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eafa2a28b5022d2454768c74e15d5ae377" title="variable item">cmVAR</a>:  <span class="keywordflow">return</span> *((TBase*)m_pTok);
<a name="l00350"></a>00350           <span class="keywordflow">default</span>:     <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">ParserError</a>(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa4e872315cffbc12a39947b60f9367088" title="A numerical function has been called with a non value type of argument.">ecVAL_EXPECTED</a>);
<a name="l00351"></a>00351         }
<a name="l00352"></a>00352       }
<a name="l00353"></a>00353 
<a name="l00354"></a>00354       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00360"></a><a class="code" href="classmu_1_1_parser_token.html#ae3125d176cc8c5238ec2d650386f449c">00360</a> <span class="comment"></span>      TBase* <a class="code" href="classmu_1_1_parser_token.html#ae3125d176cc8c5238ec2d650386f449c" title="Get address of a variable token.">GetVar</a>()<span class="keyword"> const</span>
<a name="l00361"></a>00361 <span class="keyword">      </span>{
<a name="l00362"></a>00362         <span class="keywordflow">if</span> (m_iCode!=<a class="code" href="namespacemu.html#ab77181e591bebd278bf9c7a2e30ad40eafa2a28b5022d2454768c74e15d5ae377" title="variable item">cmVAR</a>)
<a name="l00363"></a>00363                 <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">ParserError</a>(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00364"></a>00364 
<a name="l00365"></a>00365         <span class="keywordflow">return</span> (TBase*)m_pTok;
<a name="l00366"></a>00366       }
<a name="l00367"></a>00367 
<a name="l00368"></a>00368       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00373"></a><a class="code" href="classmu_1_1_parser_token.html#a0286c6356dbddebca69da1e5ebb5a888">00373</a> <span class="comment"></span>      <span class="keywordtype">int</span> <a class="code" href="classmu_1_1_parser_token.html#a0286c6356dbddebca69da1e5ebb5a888" title="Return the number of function arguments.">GetArgCount</a>()<span class="keyword"> const</span>
<a name="l00374"></a>00374 <span class="keyword">      </span>{
<a name="l00375"></a>00375         assert(m_pCallback.get());
<a name="l00376"></a>00376 
<a name="l00377"></a>00377         <span class="keywordflow">if</span> (!m_pCallback-&gt;GetAddr())
<a name="l00378"></a>00378                 <span class="keywordflow">throw</span> <a class="code" href="classmu_1_1_parser_error.html" title="Error class of the parser.">ParserError</a>(<a class="code" href="namespacemu.html#acf304a3ef5c4625d0eac5953aa1b688aa91b338cf5e35059bb452f783aeb88a5f" title="Internal error of any kind.">ecINTERNAL_ERROR</a>);
<a name="l00379"></a>00379 
<a name="l00380"></a>00380         <span class="keywordflow">return</span> m_pCallback-&gt;GetArgc();
<a name="l00381"></a>00381       }
<a name="l00382"></a>00382 
<a name="l00383"></a>00383       <span class="comment">//------------------------------------------------------------------------------</span>
<a name="l00392"></a><a class="code" href="classmu_1_1_parser_token.html#a667a6b2a30e58bc3332ef2358412c2eb">00392</a> <span class="comment"></span>      <span class="keyword">const</span> TString&amp; <a class="code" href="classmu_1_1_parser_token.html#a667a6b2a30e58bc3332ef2358412c2eb" title="Return the token identifier.">GetAsString</a>()<span class="keyword"> const</span>
<a name="l00393"></a>00393 <span class="keyword">      </span>{
<a name="l00394"></a>00394         <span class="keywordflow">return</span> m_strTok;
<a name="l00395"></a>00395       }
<a name="l00396"></a>00396   };
<a name="l00397"></a>00397 } <span class="comment">// namespace mu</span>
<a name="l00398"></a>00398 
<a name="l00399"></a>00399 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
